package com.itHsuSE.demo8;

import javax.swing.*;
import java.awt.*;

/**
 * @author Hsu琛君珩
 * @ClassName:Test12
 * @date 2023-12-19
 * @apiNote
 * @Version: v1.0
 */

public class Test12 {
    public static void main(String[] args) {
        JFrame jf = new JFrame("Frame");
        jf.setLayout((new BorderLayout()));//边界布局
        jf.setBounds(400, 300, 300, 400);

        JButton jb1 = new JButton("A");
        JButton jb2 = new JButton("B");
        JButton jb3 = new JButton("C");
        JButton jb4 = new JButton("D");
        JButton jb5 = new JButton("E");

        jf.add(jb1,BorderLayout.NORTH);//北
        jf.add(jb2,BorderLayout.EAST);//东
        jf.add(jb3,BorderLayout.SOUTH);//南
        jf.add(jb4,BorderLayout.WEST);//西
        jf.add(jb5,BorderLayout.CENTER);//中

        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
